Private Sub Workbook_BeforeClose(Cancel As Boolean)

    If Workbooks.Count > 1 Then
        Application.Visible = True
    Else
        Application.Quit
    End If

End Sub

Private Sub Workbook_Open()

    Application.Visible = False
    UserForm1.Show

End Sub
